$(document).ready(function() {
	// Store variables
	var accordion_head = $('#accordion > li > a'), accordion_body = $('#accordion > li > .sub-menu');
	// Open the first tab on load
	accordion_head.first().addClass('activeAccordion').next().slideDown('normal');
    // Click function
	accordion_head.on('click', function(event) {
		// Disable header links
		event.preventDefault();
		// Show and hide the tabs on click
		if ($(this).attr('class') != 'activeAccordion') {
			accordion_body.slideUp('normal');
			$(this).next().stop(true, true).slideToggle('normal');
			accordion_head.removeClass('activeAccordion');
			$(this).addClass('activeAccordion');
		}		
	});	
});

function setMenu(tag) {
	if (tag == null) {
		var page = location.pathname;
		var tagDefault = $("a[href$='" + page + "']");
		tagDefault.parent().addClass("active");
	} else {
		tag.addClass("active");
	}
}